<?php
class CoreErrorCode {

	const NORMAL                               	= 	"OK";
	const COMMON_ERROR                         	= 	"COM_ERROR";
	const LOAD_ENUM_FAIL                       	= 	"COR_001";
	const CANNOT_ADD_PARACLINIC_TICKET_CLOSED  	= 	"COR_002";
    const PATIENT_TYPE_NOT_SUPPORTED           	= 	"COR_003";
	const UPLOAD_ERR_FILE_TOO_LARGE				=	"COR_004";
	const UPLOAD_ERR_EXTENSION_NOT_ALLOWES		=	"COR_005";
	const UPLOAD_ERR_COMMON						=	"COR_006";

	const LOAD_LAB_MODULE_FAIL                 =   "LABCONNECTOR_001";
	const LOAD_RAD_MODULE_FAIL                 =   "RAD_CONNECTOR_001";
	const LOAD_PARACLINIQUE_MODULE_FAILR       =   "PARACLINIQUE_001";
	
	public static function getErrorMess($errCode = '') {
    	switch ($errCode) {
    		case CoreErrorCode::COMMON_ERROR:
                return L10nHelper::_("Execute task fail");
                    
    		case CoreErrorCode::LOAD_ENUM_FAIL:
    			return L10nHelper::_("Execute task fail");
    			
    		case CoreErrorCode::LOAD_LAB_MODULE_FAIL:
                return L10nHelper::_("Module laboratory isnot available");
                
            case CoreErrorCode::CANNOT_ADD_PARACLINIC_TICKET_CLOSED:
                return L10nHelper::_("Service ticket closed. Can not add more services.");
                
            case CoreErrorCode::LOAD_RAD_MODULE_FAIL:
            	return L10nHelper::_("Module radiology is not available");
            	
            case CoreErrorCode::PATIENT_TYPE_NOT_SUPPORTED:
                return L10nHelper::_("Patient type is not supported");
                
            case CoreErrorCode::UPLOAD_ERR_FILE_TOO_LARGE:
            	return L10nHelper::_('Probably the uploaded file is too large');
            	
        	case CoreErrorCode::UPLOAD_ERR_EXTENSION_NOT_ALLOWES:
        		return L10nHelper::_('The file type is not allowed');
        		
    		case CoreErrorCode::UPLOAD_ERR_COMMON:
    			return L10nHelper::_('File uploading failed');
    			
            case CoreErrorCode::LOAD_PARACLINIQUE_MODULE_FAILR:
                return L10nHelper::_('Loading paraclinique modules failed');
                
    		default:
    			return L10nHelper::_('Error occurs during operation process');    		
    	}

    }
}
?>